#ifndef MERCHANT_MODULE_H
#define MERCHANT_MODULE_H

#include <string>
#include <vector>
#include <map>

// 商家类
class Merchant {
public:
    Merchant(int user_id, std::string phone, std::string password, std::string name, std::string address)
        : user_id(user_id), phone(phone), password(password), name(name), address(address) {}

    int getUserID() const { return user_id; }
    std::string getPhone() const { return phone; }
    std::string getPassword() const { return password; }
    std::string getName() const { return name; }
    std::string getAddress() const { return address; }

    void setName(const std::string& name) { this->name = name; }
    void setAddress(const std::string& address) { this->address = address; }

private:
    int user_id;
    std::string phone;
    std::string password;
    std::string name;
    std::string address;
};

// 商家模块类
class MerchantModule {
public:
    MerchantModule() {}

    bool addDish(int merchant_id, const std::string& dish_name, double price);
    bool updateDish(int merchant_id, const std::string& dish_name, double price);
    bool deleteDish(int merchant_id, const std::string& dish_name);
    bool viewDishes(int merchant_id, std::vector<std::string>& output_dishes);

private:
    // 模拟菜品数据库
    std::map<int, std::map<std::string, double>> dishes_map;
};

#endif // MERCHANT_MODULE_H